package com.whmall.service.crm.provider;

import com.whmall.service.crm.api.CompanyUserPlatformApi;
import com.whmall.service.crm.entity.dto.companyuser.*;
import com.whmall.service.crm.module.companyuser.CompanyUserPlatformService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

@Service(interfaceClass = CompanyUserPlatformApi.class)
public class CompanyUserPlatformProvider implements CompanyUserPlatformApi {

    @Autowired
    private CompanyUserPlatformService companyUserPlatformService;

    @Override
    public List<String> listValidByUserIds(Integer index, List<Long> userIds, Integer thirdPlatformType) {
        return companyUserPlatformService.listValidByUserIds(index, userIds, thirdPlatformType);
    }

    @Override
    public Map<Long, List<String>> mapValidByUserIds(Integer index, List<Long> userIds, Integer thirdPlatformType) {
        return companyUserPlatformService.mapValidByUserIds(index, userIds, thirdPlatformType);
    }

    @Override
    public List<CompanyUserPlatformKeyFieldRspDTO> listBy(CompanyUserPlatformListByReqDTO reqDTO) {
        return companyUserPlatformService.listBy(reqDTO);
    }

    @Override
    public Boolean isBinding(Long userId, String openId, Integer thirdPlatformType) {
        return companyUserPlatformService.isBinding(userId, openId, thirdPlatformType);
    }

    @Override
    public String getSelectByUserId(Long userId, String openId, Integer thirdPlatformType) {
        return companyUserPlatformService.getSelectByUserId(userId, openId, thirdPlatformType);
    }

    @Override
    public Integer select(Long userId, String openId, Integer thirdPlatformType, Map<Integer, Integer> indexes) {
        return companyUserPlatformService.select(userId, openId, thirdPlatformType, indexes);
    }

    @Override
    public Long follow(CompanyUserPlatformSaveReqDTO reqDTO) {
        return companyUserPlatformService.follow(reqDTO);
    }

    @Override
    public void unfollow(CompanyUserPlatformUnFollowReqDTO reqDTO) {
        companyUserPlatformService.unfollow(reqDTO);
    }

    @Override
    public AccessTokenSaveRspDTO saveAccessToken(AccessTokenSaveReqDTO reqDTO) {
        return companyUserPlatformService.saveAccessToken(reqDTO);
    }

    @Override
    public void bind(Long userId, String openId, Integer thirdPlatformType) {
        companyUserPlatformService.bind(userId, openId, thirdPlatformType);
    }

    @Override
    public void unBind(Long userId, String openId, Integer thirdPlatformType) {
        companyUserPlatformService.unBind(userId, openId, thirdPlatformType);
    }

    @Override
    public void unBindForPc(Long userId, Integer thirdPlatformType) {
        companyUserPlatformService.unBindForPc(userId, thirdPlatformType);
    }
}
